﻿<Window x:Class="_13.CustomControls.TestLinkLabelWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="158" Width="380" xmlns:my="clr-namespace:_13.CustomControls">
    <Window.Resources>
        <Thickness x:Key="margin" Left="5" Top="5" Right="5" Bottom="5"/>
        <Style TargetType="Label">
            <Setter Property="HorizontalContentAlignment" Value="Right"/>
            <Setter Property="Margin" Value="{StaticResource margin}"/>
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Margin" Value="{StaticResource margin}"/>
            <Setter Property="Background" Value="GreenYellow"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Content="Text:"/>
        <Label Grid.Row="1" Grid.Column="0" Content="URI:"/>
        <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" 
                 Name="tbxText" Text="Go Google"/>
        <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" 
                 Name="tbxUri" Text="http://www.google.com"/>
        <my:LinkLabel Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="10"
                      Text="{Binding ElementName=tbxText, Path=Text}"
                      Uri="{Binding ElementName=tbxUri, Path=Text}"
                      HorizontalContentAlignment="Center"/>
    </Grid>
</Window>
